package com.fahai.web.dao;

import com.fahai.common.CommonMapper;
import com.fahai.web.entity.UserLawyer;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.provider.SpecialProvider;

/**
 * @Description
 * @Author chao
 * @Time 2017/8/16 下午2:16
 * @Version 1.0
 */
@Component
public interface UserLawyerMapper extends CommonMapper<UserLawyer> {

    /**
     * 插入数据，限制为实体包含`id`属性并且必须为自增列，实体配置的主键策略无效
     *
     * @param userLawyer
     * @return
     */
    @Options(useGeneratedKeys = true, keyProperty = "userLawyerId")
    @InsertProvider(type = SpecialProvider.class, method = "dynamicSQL")
    int insertUseGeneratedKeys(UserLawyer userLawyer);

}
